

#include <iostream>
#include "ev_tcpserver.h"
#include <event2/event.h>
#include <event2/event_struct.h>


#define TCPSERVER_DEBUG


#ifdef TCPSERVER_DEBUG
#include "log_service.h"
#include <stdlib.h>
#define TCPSERVER_LOG(...)  LogService::default_logger()->info(__VA_ARGS__)
#define TCPSERVER_ASSERT(x) do { \
    if(!(x)) { \
        LogService::default_logger()->error("func[{}]-line[{}]: assert {} failed", \
            __FUNCTION__, __LINE__, #x); \
        LogService::default_logger()->flush(); \
        exit(-1); \
    } \
} while(0)
#else
static void do_nothing1(const char*f, ...){}
static void do_nothing2(int x){}
#define TCPSERVER_LOG(...) do_nothing1(__VA_ARGS__)
#define TCPSERVER_ASSERT(x) do_nothing2(x)
#endif


EvTcpServer::EvTcpServer(uint32_t client_max)
{
}
EvTcpServer::~EvTcpServer()
{
}
int EvTcpServer::setCallBack(std::function<void(struct bufferevent*)> cb)
{
    return 0;
}